<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .box {
            width: 1366px;
            height: 600px;
            margin: 0 auto;
            background: url(./images/bg.jpg);
            /* 隐藏溢出的部分 */
            overflow: hidden;
        }
        /* 同时设置两个盒子有的共同效果 */
        .box::before,
        .box::after {
            float: left;
            content: '';
            width: 50%;
            height: 600px;
            background: url(./images/fm.jpg);
            /* 谁要过度就给谁加 */
            transition: all .5s;
        }
        .box::after {
            background-position: right 0;
        }

        /* 设置车往两边挪 */
        .box:hover::before {
            transform: translate(-100%);
        }
        .box:hover::after {
            transform: translate(100%);
        }
    </style>
</head>
<body>
    <div class="box">

    </div>
</body>
</html>